# Set the important envirimental variables that auto-conf uses to
# configure, mostly these are passed from the CMake
# configuration. Others are just explicitly passed from the
# enviroment. If there is a problem with them in the future they can
# be addressed in CMake with the same structure.

set(ENV{CC} "@CMAKE_C_COMPILER@ @CMAKE_C_COMPILER_ARG1@")
set(ENV{CFLAGS} "@CMAKE_C_FLAGS@ @CMAKE_C_FLAGS_RELEASE@")
set(ENV{CXX} "@CMAKE_CXX_COMPILER@ @CMAKE_CXX_COMPILER_ARG1@")
set(ENV{CXXFLAGS} "@CMAKE_CXX_FLAGS@ @CMAKE_CXX_FLAGS_RELEASE@")
set(ENV{LDFLAGS} "@CMAKE_LINKER_FLAGS@ @CMAKE_LINKER_FLAGS_RELEASE@")

set(ENV{LIBS} "$ENV{LIBS}")

set(ENV{CPP} "$ENV{CPP}")
set(ENV{CPPFLAGS} "$ENV{CPPFLAGS}")
set(ENV{CXXPP} "$ENV{CXXPP}")

set(ENV{CXX} "@CMAKE_CXX_COMPILER@ @CMAKE_CXX_COMPILER_ARG1@")
set(ENV{CXXFLAGS} "@CMAKE_CXX_FLAGS@ @CMAKE_CXX_FLAGS_RELEASE@")


set(ENV{YACC} "@BISON_EXECUTABLE@" )
set(ENV{YFLAGS} "@BISON_FLAGS@" )

execute_process(
  COMMAND sh @pcre_source_dir@/configure --prefix=@pcre_install_dir@  --disable-shared
  WORKING_DIRECTORY @pcre_binary_dir@
)
